package guda.house.biz.form.village;

import guda.house.dal.dataobject.UnitDO;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;


public class UnitForm {

    @NotNull(message = "不能为空")
    private Long villageId;
    @NotNull(message = "不能为空")
    private Long buildingId;
    @NotNull(message = "不能为空")
    @Size(min=0,max=10,message = "长度在0到10个字符之间")
    private String unitName;

    public Long getVillageId() {
        return villageId;
    }

    public void setVillageId(Long villageId) {
        this.villageId = villageId;
    }

    public Long getBuildingId() {
        return buildingId;
    }

    public void setBuildingId(Long buildingId) {
        this.buildingId = buildingId;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public UnitDO toDO() {
        UnitDO unitDO = new UnitDO();
        unitDO.setBuildingId(buildingId);
        unitDO.setUnitName(unitName);
        return unitDO;
    }

}
